#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>

#define MAX(a,b) ((a)>(b) ? (a) : (b))  

int largestAltitude(int* gain, int gainSize) {
    int max = 0;
    int ans = 0;
    for (int i = 0; i < gainSize; i++)
    {
        ans += gain[i];
        max = MAX(max, ans);
    }
    return max;
}

int main()
{
	
	return 0;
}